﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ViewApprovalControl.ascx.cs"
    Inherits="CarRent.Controls.ViewApprovalControl" %>
<div id="approval-dialog">
    <div class="row">
        <div class="label">
            Full name:</div>
        <div class="field">
            <label id="lblFullName" />
        </div>
    </div>
    <div class="row">
        <div class="label">
            From time:</div>
        <div class="field">
            <label id="lblFromTime" />
        </div>
        <div class="label">
            To time:</div>
        <div class="field">
            <label id="lblToTime" />
        </div>
    </div>
    <div class="row">
        <div class="label">
            From date:</div>
        <div class="field">
            <label id="lblFromDate" />
        </div>
        <div class="label">
            To date:</div>
        <div class="field">
            <label id="lblToDate" />
        </div>
    </div>
    <div class="row">
        <div class="label">
            Car:</div>
        <div class="field">
            <label id="lblCar" />
        </div>
    </div>
    <div class="row">
        <div class="label">
            Destination:</div>
        <div class="field">
            <label id="lblDestination" />
        </div>
    </div>
    <div class="row">
        <div class="label">
            Purpose:</div>
        <div class="field">
            <label id="lblPurpose" />
        </div>
    </div>
    <div class="row">
        <div class="label">
            Requested date:</div>
        <div class="field">
            <label id="lblRequestDate" />
        </div>
    </div>
    <div class="row">
        <div class="label">
            Start (KM):</div>
        <div class="field">
            <label id="startKM" />
        </div>
        <div class="label">
            End (KM):</div>
        <div class="field">
            <label id="endKM" />
        </div>
    </div>
    <div class="row">
        <div class="label">
            Depart time:</div>
        <div class="field">
            <label id="departDate" />
        </div>
    </div>
    <div class="row">
        <div class="label">
            Arrival time:</div>
        <div class="field">
            <label id="arrivalDate" />
        </div>
    </div>
    <div class="row">
        <div class="label">
            Admin remark:</div>
        <div class="field">
            <label id="remark" />
        </div>
    </div>
</div>
<input type="hidden" id="hidBookingId" />
<input type="hidden" id="hidIsApproval" />
<script type="text/javascript">

    $(document).ready(function () {

        $("#approval-dialog").dialog({
            autoOpen: false,
            title: 'View Booking',
            width: 680,
            modal: true,
            buttons: [
            {
                text: "Close",
                "class": 'btnCancel',
                click: function () {
                    // Cancel code here
                    $(this).dialog("close");
                }
            }
        ],
            close: function () {
            }
        });
    });

    function loadBookingData(booking) {
        $('#lblFullName').text(booking.FullName);
        $('#lblFromTime').text(booking.FromTime);
        $('#lblToTime').text(booking.ToTime);
        $('#lblFromDate').text(booking.FromDate);
        $('#lblToDate').text(booking.ToDate);
        $('#lblCar').text(booking.CarName);
        $('#lblDestination').text(booking.Destination);
        $('#lblPurpose').text(booking.Purpose);
        $('#lblRequestDate').text(booking.RequestDate);
        $('#startKM').text(booking.StartKM);
        $('#endKM').text(booking.EndKM);
        $('#departDate').text(booking.DepartDate + ' ' + booking.DepartTime);
        $('#arrivalDate').text(booking.ArrivalDate + ' ' + booking.ArrivalTime);
        $('#remark').text(booking.Remark);
        $('#hidBookingId').text(booking.BookingID);
        $('#hidIsApproval').text(booking.IsApproval);
    }

</script>
